package sm.upgrade.main;

import org.springframework.context.support.ClassPathXmlApplicationContext;

import sm.upgrade.DataUpgradeImpl;
import sm.upgrade.api.DataUpgrade;
import sm.upgrade.api.UpgradePhase;
import sm.upgrade.util.UpgradeContext;

public class UpgradeDataMain {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		UpgradeContext context = UpgradeContext.getInstance();
		ClassPathXmlApplicationContext customerContext = context
				.getOrCreateCustomerContext();
		UpgradePhase upgrade = (UpgradePhase) customerContext
				.getBean("sqlmappingUpgrade");
		upgrade.upgrade();

		DataUpgrade dataUpgrade = new DataUpgradeImpl();
		dataUpgrade.upgradeData();

		upgrade = (UpgradePhase) customerContext.getBean("userLangUpgrade");
		upgrade.upgrade();

		upgrade = (UpgradePhase) customerContext.getBean("expireListUpgrade");
		upgrade.upgrade();

		upgrade = (UpgradePhase) customerContext.getBean("dataPolicyUpgrade");
		upgrade.upgrade();

		upgrade = (UpgradePhase) customerContext
				.getBean("configMgmtEnvUpgrade");
		upgrade.upgrade();

		upgrade = (UpgradePhase) customerContext.getBean("todoUpgrade");
		upgrade.upgrade();

		upgrade = (UpgradePhase) customerContext.getBean("slaTypeUpgrade");
		upgrade.upgrade();

		upgrade = (UpgradePhase) customerContext
				.getBean("icmenvMassUpdateUpgrade");
		upgrade.upgrade();

		upgrade = (UpgradePhase) customerContext.getBean("languageKMIdUpgrade");
		upgrade.upgrade();

		upgrade = (UpgradePhase) customerContext
				.getBean("svcCatalogDetailedDescUpgrade");
		upgrade.upgrade();

		upgrade = (UpgradePhase) customerContext
				.getBean("migrateSvcDisplayUpgrade");
		upgrade.upgrade();

		upgrade = (UpgradePhase) customerContext
				.getBean("slamodulecontrolUpgrade");
		upgrade.upgrade();

		upgrade = (UpgradePhase) customerContext
				.getBean("sysAttachementsUpgrade");
		upgrade.upgrade();

		upgrade = (UpgradePhase) customerContext.getBean("mySMUpgrade");
		upgrade.upgrade();

		upgrade = (UpgradePhase) customerContext.getBean("fixInboxDataUpgrade");
		upgrade.upgrade();

		upgrade = (UpgradePhase) customerContext.getBean("kmOperatorUpgrade");
		upgrade.upgrade();
	}

}
